home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_08_05 / 8n05024b < prev    next >
Text File  |  1990-04-17  |  1KB  |  29 lines

  1. *****Listing 2*****
  2.  
  3.     /* Executable string: drive select
  4.        Assembly      Hex     Octal   Comment
  5.         TFR   D,X     1F      037     transfer fcb addr to X
  6.                       01      001
  7.         JSR   $DE0C   BD      275     call the FLEX routine
  8.                       DE      336
  9.                       0C      014
  10.         BCS   +3      25      045     branch if error (carry set)
  11.                       03      003     3 bytes beyond this branch
  12.         CLRA          4F      117     make D=0 (ACCB+ACCB=D)
  13.         CLRB          5F      137
  14.         RTS           39      071     return zero to caller
  15.         LDD   #-1     CC      314     make D= -1 (ERROR)
  16.                       FF      377
  17.                       FF      377
  18.         RTS           39      071     return ERROR to caller
  19.     */
  20.     
  21.     FILE  *fcb;
  22.     char  *drvset =
  23.       "\037\001\275\336\014\045\003\117\137\071\314\377\377\071";
  24.     
  25.     /* code fragment using drvset; reports and exits if error */
  26.     if( (*((int (*)())drvset))(fcb) == ERROR )
  27.       errxit(fcb->errno);
  28.  
  29.